package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.controller.NursingProjectController;
import com.zzyl.vo.NursingProjectPageVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ffk
 * @date 2024/5/16 9:37
 */


@RequestMapping("/customer/orders")
@RestController
@Api(tags = "用户护理项目管理")
public class CustomerNursingProjectController {

    @Autowired
    NursingProjectController nursingProjectController;

    //分页查询护理项目列表
    @GetMapping("/project/page")
    public ResponseResult<PageResponse<NursingProjectPageVo>> findByPage(@RequestParam(defaultValue = "1") Integer pageNum,
                                                                         @RequestParam(defaultValue = "5") Integer pageSize,
                                                                         @RequestParam(required = false) String name,
                                                                         @RequestParam(required = false) Integer status){
        return nursingProjectController.queryByPage(pageNum,pageSize,name,status);
    }

    @GetMapping("/project/{id}")
    @ApiOperation("用户根据id查询护理项目信息")
    public ResponseResult<NursingProjectPageVo> findProjectById(@PathVariable Long id){
        return nursingProjectController.queryById(id);
    }


}
